﻿function getParam(paramName) {
    paramValue = "";
    isFound = false;
    if (this.location.search.indexOf("?") == 0 && this.location.search.indexOf("=") > 1) {
        arrSource = unescape(this.location.search).substring(1, this.location.search.length).split("&");
        i = 0;
        while (i < arrSource.length && !isFound) {
            if (arrSource[i].indexOf("=") > 0) {
                if (arrSource[i].split("=")[0].toLowerCase() == paramName.toLowerCase()) {
                    paramValue = arrSource[i].split("=")[1];
                    isFound = true;
                }
            }
            i++;
        }
    }
    return paramValue;
}

$(document).ready(function () {

    self.moveTo(0, 0);
    self.resizeTo(screen.availWidth, screen.availHeight);

    //参数初始化  ExamDataManage
    ExamDataManage.kaoshiId = getParam("kc");
    ExamDataManage.comminfo.examid = getParam("exid");
    if (getParam("exprot") == "11") {
        ExamDataManage.isexprot = true;
    }
    ExamLoadManage.data = { kaoshiId: ExamDataManage.kaoshiId, examid: ExamDataManage.comminfo.examid };
    ExamLoadManage.ready();

});


var KSConfig = {
    URLAssembly: {
        Test: {
            Server: {
                //得到
                GetExam: "../WebServer/ExamOnline.ashx?Action=GetExamView"
            }
        }
    }
};


var ExamLoadManage = {
    isNew: false,
    typeTeam: 0,
    data: null,
    action: 0,
    iscomplete: 0,
    ready: function () {
        this.complete();
    },
    //页面加载完成之后
    complete: function () {
        AjaxExamManage.onlineExam();

    }

};
//提交后台
var AjaxExamManage = {
    isSubmit: false,
    _exmaType: 1,
    textJsonData: 0,
    isRefersh: false,
    unPostArry: [],
    userID: 0,
    //试卷
    onlineExam: function () {
            this.Post(KSConfig.URLAssembly.Test.Server.GetExam, ExamLoadManage.data, function (data) {

                if (data.IsSuccess == 1) {
                    SetExamTest.closeJson(data.Data);
                }
                //提交服务器失败
                else {
                    showErrorTip(data.Msg);
                }
            }, function (xml, text, thrown) {
                showErrorTip(text);
            });
       
    },
    Post: function (_url, _pars, fcsuccess, fcerror) {
        $.ajax({
            type: "POST",
            url: _url,
            data: _pars,
            dataType: "json",
            //提交服务器成功
            success: fcsuccess,
            //提交服务器错误
            error: fcerror
        });
    }
};

//设置试卷
var SetExamTest = {
    isCommon: true,
    isInit: false,
    isAdmin: false,
    titleID: 0,
    topictypeIndex: 1,
    htmlBuild: "",
    closeJson: function (data) {
        if (data != null) {
            ExamDataManage.topicLen1 = data.topicLen1;
            ExamDataManage.topicscore1 = data.topicscore1;
            ExamDataManage.topicLen2 = data.topicLen2;
            ExamDataManage.topicscore2 = data.topicscore2;
            ExamDataManage.topicLen3 = data.topicLen3;
            ExamDataManage.topicscore3 = data.topicscore3;
            ExamDataManage.topicLen4 = data.topicLen4;
            ExamDataManage.topicscore4 = data.topicscore4;
            ExamDataManage.topicLen5 = data.topicLen5;
            ExamDataManage.topicscore5 = data.topicscore5;
            ExamDataManage.topicLen6 = data.topicLen6;
            ExamDataManage.topicscore6 = data.topicscore6;
            ExamDataManage.comminfo = data.comminfo;
            ExamDataManage.topic1 = data.topic1;
            // ExamDataManage.answer1 = data.answer1;
            ExamDataManage.topic2 = data.topic2;
            // ExamDataManage.answer2 = data.answer2;
            ExamDataManage.topic3 = data.topic3;
            // ExamDataManage.answer3 = data.answer3;
            ExamDataManage.topic4 = data.topic4;
            // ExamDataManage.answer4 = data.answer4;
            ExamDataManage.topic5 = data.topic5;
            // ExamDataManage.answer5 = data.answer5;
            ExamDataManage.topic6 = data.topic6;


            this.viewSubList();
        } //end if
    },
    //显示题目
    viewSubList: function () {
        this.InitTopic1();
        this.InitTopic2();
        this.InitTopic3();
        this.InitTopic4();
        this.InitTopic5();
        this.InitTopic6();
        //
        $(".E_E_L_I_C_R_Content").append(this.htmlBuild);
        //显示公告信息  
        $("#spexname").html(ExamDataManage.comminfo.examname);
        $("#spusername").html("考生:"+ExamDataManage.comminfo.username);
        $("#spLanxi").html("&nbsp;&nbsp;电话:" + ExamDataManage.comminfo.phone + "&nbsp;&nbsp;部门:" + ExamDataManage.comminfo.department + "&nbsp;&nbsp;工号:" + ExamDataManage.comminfo.workcode);

        //加文件信息
        if (ExamDataManage.isexprot) {
            Export();
        }
        //加载完成等待
        ExamLoadManage.iscomplete = 1;
    },
    //单选择题
    InitTopic1: function () {
        if (ExamDataManage.topicLen1 > 0 && ExamDataManage.topic1 != null && ExamDataManage.answer1 != null) {
            //生成试题
            this.htmlBuild = this.getTopicTypeDiv(1, (ExamDataManage.topicscore1 / ExamDataManage.topicLen1), ExamDataManage.topicscore1);
            this.htmlBuild += "<div class=\"E_E_L_I_C_R_C_Font\">";
            for (var i = 0; i < ExamDataManage.topicLen1; i++) {

                var Itemtopic = ExamDataManage.topic1[i];
                var ItemAswer = ExamDataManage.topic1[i].answer;
                var ItemAswer2 = ExamDataManage.topic1[i].answer2;
                this.htmlBuild += this.getTopicOne(1, Itemtopic, ItemAswer, ItemAswer2, (i + 1), "opbtn_radio", "opbtn_r_checked");
            }
            this.htmlBuild += "</div>";
            //体型序号增加
            this.topictypeIndex++;
        }
    },
    //多选
    InitTopic2: function () {
        if (ExamDataManage.topicLen2 > 0 && ExamDataManage.topic2 != null && ExamDataManage.answer2 != null) {
            //生成试题
            this.htmlBuild += this.getTopicTypeDiv(2, (ExamDataManage.topicscore2 / ExamDataManage.topicLen2), ExamDataManage.topicscore2);
            this.htmlBuild += "<div class=\"E_E_L_I_C_R_C_Font\">";
            for (var i = 0; i < ExamDataManage.topicLen2; i++) {
                var Itemtopic = ExamDataManage.topic2[i];
                var ItemAswer = ExamDataManage.topic2[i].answer; //this.getTopicAnswerObje(Itemtopic.id, ExamDataManage.answer2);
                var ItemAswer2 = ExamDataManage.topic2[i].answer2;
                this.htmlBuild += this.getTopicOne(2, Itemtopic, ItemAswer, ItemAswer2, (i + 1), "opbtn_checkBox", "opbtn_c_checked");
            }
            this.htmlBuild += "</div>";
            //体型序号增加
            this.topictypeIndex++;
        }
    },
    //判断
    InitTopic3: function () {
        if (ExamDataManage.topicLen3 > 0 && ExamDataManage.topic3 != null && ExamDataManage.answer3 != null) {
            //生成试题
            this.htmlBuild += this.getTopicTypeDiv(3, (ExamDataManage.topicscore3 / ExamDataManage.topicLen3), ExamDataManage.topicscore3);
            this.htmlBuild += "<div class=\"E_E_L_I_C_R_C_Font\">";
            for (var i = 0; i < ExamDataManage.topicLen3; i++) {
                var Itemtopic = ExamDataManage.topic3[i];
                var ItemAswer = ExamDataManage.topic3[i].answer;  //this.getTopicAnswerObje(Itemtopic.id, ExamDataManage.answer3);
                var ItemAswer2 = ExamDataManage.topic3[i].answer2;
                this.htmlBuild += this.getTopicOne3(3, Itemtopic, ItemAswer, ItemAswer2, (i + 1));
            }
            this.htmlBuild += "</div>";
            //体型序号增加
            this.topictypeIndex++;
        }
    },
    //填空
    InitTopic4: function () {
        if (ExamDataManage.topicLen4 > 0 && ExamDataManage.topic4 != null && ExamDataManage.answer4 != null) {
            //生成试题
            this.htmlBuild += this.getTopicTypeDiv(4, (ExamDataManage.topicscore4 / ExamDataManage.topicLen4), ExamDataManage.topicscore4);
            this.htmlBuild += "<div class=\"E_E_L_I_C_R_C_Font\">";
            for (var i = 0; i < ExamDataManage.topicLen4; i++) {
                var Itemtopic = ExamDataManage.topic4[i];
                var ItemAswer = ExamDataManage.topic4[i].answer; //this.getTopicAnswerObje(Itemtopic.id, ExamDataManage.answer4);
                var ItemAswer2 = null;
                if (ExamDataManage.topic4[i].answer2 != null)
                    ItemAswer2 = ExamDataManage.topic4[i].answer2;
                this.htmlBuild += this.getTopicOne4(4, Itemtopic, ItemAswer, ItemAswer2, (i + 1));
            }
            this.htmlBuild += "</div>";
            //体型序号增加
            this.topictypeIndex++;
        }
    },
    //问答题
    InitTopic5: function () {
        if (ExamDataManage.topicLen5 > 0 && ExamDataManage.topic5 != null && ExamDataManage.answer5 != null) {
            //生成试题
            this.htmlBuild += this.getTopicTypeDiv(5, (ExamDataManage.topicscore5 / ExamDataManage.topicLen5), ExamDataManage.topicscore5);
            this.htmlBuild += "<div class=\"E_E_L_I_C_R_C_Font\">";
            for (var i = 0; i < ExamDataManage.topicLen5; i++) {
                var Itemtopic = ExamDataManage.topic5[i];
                var ItemAswer2 = ExamDataManage.topic5[i].answer2;
                var ItemAswer = ExamDataManage.topic5[i].answer;
                this.htmlBuild += this.getTopicOne5(5, Itemtopic, ItemAswer, ItemAswer2, (i + 1));
            }
            this.htmlBuild += "</div>";
            //体型序号增加
            this.topictypeIndex++;
        }
    },
    InitTopic6: function () {
        if (ExamDataManage.topicLen6 > 0 && ExamDataManage.topic6 != null) {

            this.htmlBuild += this.getTopicTypeDiv(6, (ExamDataManage.topicscore6 / ExamDataManage.topicLen6), ExamDataManage.topicscore6);
            this.htmlBuild += "<div class=\"E_E_L_I_C_R_C_Font\">";

            this.htmlBuild += this.getTopicOne6(6, ExamDataManage.topic6[0], 1);

            this.htmlBuild += "</div>";

        }
    },
    //获分类
    getTopicTypeDiv: function (topicTypeId, mtscore, sumscore) {
        var topicName = "";
        switch (topicTypeId) {
            case 1:
                topicName = "单项选择题(<span style='color:blue;font-size:11pt'>绿色√符号表示考生答案</span>，<span style='color:red;font-size:11pt'>红色★符号表示正确答案</span>)";
                break;
            case 2:
                topicName = "多项选择题(<span style='color:blue;font-size:11pt'>绿色√符号表示考生答案</span>，<span style='color:red;font-size:11pt'>红色★符号表示正确答案</span>)";
                break;
            case 3:
                topicName = "判断题(<span style='color:blue;font-size:11pt'>绿色√符号表示考生答案</span>，<span style='color:red;font-size:11pt'>红色★符号表示正确答案</span>)";
                break;
            case 4:
                topicName = "填空题";
                break;
            case 5:
                topicName = "问答题";
                break;
            case 6:
                topicName = "打字题";
                break;
        }
        //var _html = "<div class=\"E_E_L_I_C_R_C_Title\" id=\"topic" + topicTypeId + "\"><div class=\"E_E_L_I_C_R_C_T_SubType\">" + this.getTopicTypeNum() + topicName + "</div><div class=\"E_E_L_I_C_R_C_T_Explain\">说明:（<label style=\"COLOR: #369\" >(每小题" + mtscore + "分，共" + sumscore + "分)</label>）</div></div>"
        var _html = "<div class=\"E_E_L_I_C_R_C_Title\" id=\"topic" + topicTypeId + "\"><div class=\"E_E_L_I_C_R_C_T_SubType\">" + this.getTopicTypeNum() + topicName + "</div><div class=\"E_E_L_I_C_R_C_T_Explain\"><label style=\"COLOR: #369\" ></div></div>"
        return _html;
    },
    getTopicOne: function (topicTypeId, topicItem, answerItem, anserItem2, index, classs, selectclass) {
        var _htmstr = " <div id=\"topic" + topicTypeId + "_" + topicItem.id + "\" class=\"stViewItem\"><div class=\"stViewHead\"><table><tbody><tr><td style=\"WHITE-SPACE: nowrap; VERTICAL-ALIGN: top\"><label style=\"FLOAT: left\" class=\"stViewOrdNum\">" + index + ".</label></td><td><div style=\"LINE-HEIGHT: 1.5em; VERTICAL-ALIGN: middle\">" + topicItem.title + "（）。<span class=\"stViewScore\">(考生得分：" + topicItem.scoreOK + "分，满分：" + topicItem.score + "分)</span></div></td></tr></tbody></table></div><div class=\"stViewCont\">";
        var _temp = "";

        for (var i = 0; i < answerItem.length; i++) {
            var _sclass = "&nbsp;&nbsp;";
            for (var j = 0; j < anserItem2.length; j++) {
                if (answerItem[i].id == anserItem2[j].id) {
                    _sclass = "√";
                }
            }
            var xxx = topicTypeId == 1 ? "﹝" + _sclass + "﹞" : "【" + _sclass + "】";
            _temp += "<div class=\"stViewOption\"><span style='color:red;font-weight:bole;'>" + (answerItem[i].right == 1 ? "★" : "&nbsp;&nbsp;&nbsp;") + "</span><span style='color:blue;font-weight:bole;'>" + xxx + "</span><label>(" + ExamDataManage.getUpperCase(i) + ") </label>" + answerItem[i].answer + " </div>";
        }
        _htmstr += _temp + "</div></div>";
        return _htmstr;
    },
    getTopicOne3: function (topicTypeId, topicItem, answerItem, anserItem2, index) {
        var _htmstr = " <div id=\"topic" + topicTypeId + "_" + topicItem.id + "\" class=\"stViewItem\"><div class=\"stViewHead\"><table><tbody><tr><td style=\"WHITE-SPACE: nowrap; VERTICAL-ALIGN: top\"><label style=\"FLOAT: left\" class=\"stViewOrdNum\">" + index + ".</label></td><td><div style=\"LINE-HEIGHT: 1.5em; VERTICAL-ALIGN: middle\">" + topicItem.title + "（）。<span class=\"stViewScore\">(考生得分：" + topicItem.scoreOK + "分，满分：" + topicItem.score + "分)</span></div></td></tr></tbody></table></div><div class=\"stViewCont\">";
        var _temp = "<div class=\"stViewOption\">";
        for (var i = 0; i < answerItem.length; i++) {
            var _sclass = "&nbsp;&nbsp;";
            for (var j = 0; j < anserItem2.length; j++) {
                if (answerItem[i].id == anserItem2[j].id) {
                    _sclass = "√";
                }
            }
            _temp += "<span style='color:red;font-weight:bole;'>" + (answerItem[i].right == 1 ? "★" : "&nbsp;&nbsp;&nbsp;") + "</span><span style='color:blue;'>﹝" + _sclass + "﹞</span>" + answerItem[i].answer + "&nbsp;&nbsp;&nbsp;";
        }
        _htmstr += _temp + "</div></div></div>";
        return _htmstr;
    },
    getTopicOne4: function (topicTypeId, topicItem, Itemanser, anserItem2, index) {
        //找到字符串替换成输入框
        var _temp1 = topicItem.title;

        for (var i = 0; i < Itemanser.length; i++) {
            var __A = "【.第" + Itemanser[i].code + "空.】";
            var _tVale = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
            for (var j = 0; j < anserItem2.length; j++) {
                if (Itemanser[i].id == anserItem2[j].id) {
                    _tVale = anserItem2[j].answer;
                }
            }
            var _temp = "<u>" + _tVale + "</u><span style='color:red'>(正确答案:" + Itemanser[i].answer + ")</span>";
            _temp1 = _temp1.replace(__A, _temp);
        }


        var _htmstr = " <div id=\"topic" + topicTypeId + "_" + topicItem.id + "\" class=\"stViewItem\"><div class=\"stViewHead\"><table><tbody><tr><td style=\"WHITE-SPACE: nowrap; VERTICAL-ALIGN: top\"><label style=\"FLOAT: left\" class=\"stViewOrdNum\">" + index + ".</label></td><td><div style=\"LINE-HEIGHT: 1.5em; VERTICAL-ALIGN: middle\">" + _temp1 + "<span class=\"stViewScore\">(考生得分：" + topicItem.scoreOK + "分，满分：" + topicItem.score + "分)</span></div></td></tr></tbody></table></div><div class=\"stViewCont\"></div></div>";

        return _htmstr;
    },
    getTopicOne5: function (topicTypeId, topicItem, Itemanser, ItemAswer2, index) {
        var _htmstr = " <div id=\"topic" + topicTypeId + "_" + topicItem.id + "\" class=\"stViewItem\"><div class=\"stViewHead\"><table><tbody><tr><td style=\"WHITE-SPACE: nowrap; VERTICAL-ALIGN: top\"><label style=\"FLOAT: left\" class=\"stViewOrdNum\">" + index + ".</label></td><td><div style=\"LINE-HEIGHT: 1.5em; VERTICAL-ALIGN: middle\">" + topicItem.title + "（）。<span class=\"stViewScore\">(考生得分：" + topicItem.scoreOK + "分，满分：" + topicItem.score + "分)</span></div></td></tr></tbody></table></div><div class=\"stViewCont\">";
        var _tVale = "";
        for (var j = 0; j < ItemAswer2.length; j++) {
            _tVale = ItemAswer2[j].answer;
        }

        _htmstr += "<span style='color:blue'>考生答案：</span><div >" + _tVale + "</div>";
        _htmstr += "<span style='color:red'>参考答案：</span><div >" + Itemanser[0].answer + "</div>";
        _htmstr += "</div></div>";
        return _htmstr;
    },
    getTopicOne6: function (topicTypeId, topicItem, index) {

        //scoreOK
        var _htmstr = " <div id=\"topic" + topicTypeId + "_" + topicItem.id + "\" class=\"stViewItem\"><div class=\"stViewHead\"><table><tbody><tr><td style=\"WHITE-SPACE: nowrap; VERTICAL-ALIGN: top\"><label style=\"FLOAT: left\" class=\"stViewOrdNum\">" + index + ".</label></td><td><div style=\"LINE-HEIGHT: 1.5em; VERTICAL-ALIGN: middle\">" + topicItem.title + "<span class=\"stViewScore\"></span></div></td></tr></tbody></table></div><div class=\"stViewCont\">";
        _htmstr += "<div style=\"margin:5px 0px;\"><span class=\"stViewScore\">(考生得分：" + topicItem.scoreOK + "分，满分：" + topicItem.score + "分)";

        _htmstr += "<div id=\"divText\"  style=\" z-index:2; word-spacing:0px; letter-spacing:0px; word-break:break-all; word-wrap:break-word; position:absolute; padding:0px; margin:0px; left:0px; width:680px; color:Yellow; line-height:60px; font-family:Consolas; font-size:24px;\"></div></div>";


        return _htmstr;
    },
    getTopicAnswerObje: function (topicId, answer) {
        var _opItem, _opData = new Array();
        var anlen = answer.length;
        var newRow = 0;
        for (var i = 0; i < anlen; i++) {
            _opItem = answer[i];
            if (_opItem.topic == topicId) {
                _opData[newRow] = _opItem;
                newRow++;
            }
        }
        return _opData;
    },
    getTopicTypeNum: function () {
        switch (this.topictypeIndex) {
            case 1:
                return "一. ";
                break;
            case 2:
                return "二. ";
                break;
            case 3:
                return "三. ";
                break;
            case 4:
                return "四. ";
                break;
            case 5:
                return "五. ";
                break;
            case 6:
                return "六. ";
                break;
        }
    }
};
//做答试题
var ViewLibMakeAnswer = {
    //选择一个选项ID
    checkOption: function (own, topicId, mark, opID) {
        var _html;
        switch (mark) {
            case "1": //单
                $(own).parent("div").parent("div").find("a").each(function (i) {

                    if ($(this).hasClass("opbtn_r_checked")) {
                        $(this).removeClass("opbtn_r_checked").addClass("opbtn_radio");

                    }
                });
                if ($(own).hasClass("opbtn_r_checked")) {
                    $(own).removeClass("opbtn_r_checked").addClass("opbtn_radio");
                } else {
                    $(own).removeClass("opbtn_radio").addClass("opbtn_r_checked");
                }
                this.checkOptionT1(topicId, opID);
                break;
            case "2": //多
                var isselect = 0;
                if ($(own).hasClass("opbtn_c_checked")) {
                    $(own).removeClass("opbtn_c_checked").addClass("opbtn_checkBox");
                } else {
                    $(own).removeClass("opbtn_checkBox").addClass("opbtn_c_checked");
                    isselect = 1;
                }
                this.checkOptionT2(topicId, opID, isselect);
                break;
            case "3": //判断
                var issselect = 0;
                $(own).parent("div").find("a").each(function (i) {

                    if ($(this).hasClass("opbtn_r_checked")) {
                        $(this).removeClass("opbtn_r_checked").addClass("opbtn_radio");
                    }
                });
                if ($(own).hasClass("opbtn_r_checked")) {
                    $(own).removeClass("opbtn_r_checked").addClass("opbtn_radio");
                    issselect = 0;
                } else {
                    $(own).removeClass("opbtn_radio").addClass("opbtn_r_checked");
                    issselect = 1;
                }
                this.checkOptionT3(topicId, opID, issselect);
                break;
            default:
                _html = "";
                break;
        }



        //_html != "" && this.refHtml(own, _html);
    },

    //选择单选题的一个选项ID
    checkOptionT1: function (topicId, opID, isselect) {
        //提交单选
        var pars = { uid: ExamDataManage.comminfo.userid, topicid: topicId, topicType: 1, anserid: opID, kaoshiId: ExamDataManage.kaoshiId, isWrite: isselect };
        this.onsbmit(KSConfig.URLAssembly.Test.Server.SaveExam, pars);
        return "";
    },
    //选择多选题的一个选项ID
    checkOptionT2: function (topicId, opID, isselect) {

        var pars = { uid: ExamDataManage.comminfo.userid, topicid: topicId, topicType: 2, anserid: opID, kaoshiId: ExamDataManage.kaoshiId, isWrite: isselect };
        this.onsbmit(KSConfig.URLAssembly.Test.Server.SaveExam, pars);
        return "";

    },
    //判断
    checkOptionT3: function (topicId, opID, isselect) {
        var pars = { uid: ExamDataManage.comminfo.userid, topicid: topicId, topicType: 3, anserid: opID, kaoshiId: ExamDataManage.kaoshiId, isWrite: isselect };
        this.onsbmit(KSConfig.URLAssembly.Test.Server.SaveExam, pars);
        return "";
    },
    //填空
    changeInput: function (topicId, opID, code, val) {
        var pars = { uid: ExamDataManage.comminfo.userid, topicid: topicId, topicType: 4, anserid: opID, kaoshiId: ExamDataManage.kaoshiId, code: code, anval: val };


        this.onsbmit(KSConfig.URLAssembly.Test.Server.SaveExam, pars);
    },
    changeInput5: function (topicId, val) {
        var pars = { uid: ExamDataManage.comminfo.userid, topicid: topicId, topicType: 5, anserid: 1, anval: val, kaoshiId: ExamDataManage.kaoshiId };
        this.onsbmit(KSConfig.URLAssembly.Test.Server.SaveExam, pars);
    },
    changeInput6: function (topicId, score, val) {
        var spanRate = $("#spanRate").text();
        var pars = { uid: ExamDataManage.comminfo.userid, topicid: topicId, topicType: 6, spanRate: spanRate, anserid: 1, anval: "", kaoshiId: ExamDataManage.kaoshiId, score: score };
        this.onsbmit(KSConfig.URLAssembly.Test.Server.SaveExam, pars);
    },
    //更新HTML
    refHtml: function (own, html) {
        $(own).parent("div").parent("div").html(html);
    },
    onsbmit: function (_action, pars) {

        if (AjaxExamManage.isSubmit) {

            AjaxExamManage.Post(_action, pars, function (data) {

                if (data.IsSuccess == 1) {

                }
                //提交服务器失败
                else {
                    AjaxExamManage.unPostArry.push(pars);
                }
            }, function (xml, text, thrown) {
                AjaxExamManage.unPostArry.push(pars);
            });
        } //end
    }
};
var ExamDataManage = {
    topicLen1: 0, //(单项选择题)长度(0--没题)
    topicscore1: 0,
    topicLen2: 0, //(多项选择题)长度(0--没题)
    topicscore2: 0,
    topicLen3: 0, //(判断题)长度(0--没题)
    topicscore3: 0,
    topicLen4: 0, //(填空择题)长度(0--没题)
    topicscore4: 0,
    topicLen5: 0, //(问答题题)长度(0--没题)
    topicscore5: 0,
    topicLen6: 0, //(打字题题)长度(0--没题)
    topicscore6: 0,
    kaoshiId: 0,
    comminfo: {
        examid: 0,
        examname: "",
        userid: 0,
        username: "",
        phone: "",
        department: "",
        workcode: "",
        email: "",
        modeid: "",
        modename: "",
        totaltopic: 0,
        totalscore: 0,
        totaltime: 0,
        totalH: 0,
        totalM: 0
    },
    topic1: [],
    answer1: [],
    topic2: [],
    answer2: [],
    topic3: [],
    answer3: [],
    topic4: [],
    answer4: [],
    topic5: [],
    answer5: [],
    topic6: [],
    isCtrlChage: false,
    isexprot:false,
    //获取对应的小写字母
    getLowerCase: function (num) {
        return String.fromCharCode(97 + num);
    },

    //获取对应的大写字母
    getUpperCase: function (num) {
        return String.fromCharCode(65 + num);
    },
    //文本转换为Json格式
    textToJson: function (text) {
        return JSON.textToJson(text);
    },
    //JSON格式转换为TEXT格式
    jsonToText: function (json) {
        return JSON.jsonToText(json);
    }
};